package com.wwg.cms.service.impl;

import java.util.Collection;
import com.wwg.cms.bo.*;
import com.wwg.cms.service.*;
import com.css.framework.dao.GeneralDao;

import com.wwg.cms.bo.entity.*;

/**
 * 
 * create by wwl
 * 
 * @author wwl
 */
public class PlacardServiceImpl implements PlacardService{

    private GeneralDao generalDao;
      
    public void setGeneralDao(GeneralDao generalDao) {
	        this.generalDao = generalDao;
	}
    
   
    
    /**
	 *获取所有
	 */
	public Collection getPlacardList(){
     String hsql="select ent from PlacardEntity as ent ";
     return generalDao.find(hsql);
    
    }
	
	/**
	 * 添加
	 * @param placard 
	 * @return
	 */
	public Placard addPlacard(Placard placard){
   
			generalDao.save(placard);
		    
    return placard;
    
    }
	
	/**
	 * 修改
	 * @param placard 
	 * @return
	 */
	public  Placard updatePlacard(Placard placard){
    
            generalDao.saveOrUpdate(placard); 
	
        
        return placard;
    }
	
	/**
	 * 删除
	 * @param placard 
	 * @return
	 */
	public Placard deletePlacard(Placard placard){
      		generalDao.delete(placard);
		
        return placard;
    }
    
    /**
     *  获取 by id
     *  @param id 编号
     * @return
	 */
    public Placard getPlacardById(Long id){
    
   
     return (Placard)generalDao.fetch(id,PlacardEntity.class);
    
    }
    
}
